package com.lc202310;

import java.util.Arrays;

/**
 * Description:
 *
 * @Create 2023/10/29 22:38
 * @Version 1.0
 */
public class Solution274 {
    public int hIndex(int[] citations) {
        Arrays.sort(citations);
        int length = citations.length;
        for (int i = 1; i <= length; i++) {
            if (citations[length - i] >= i) {
                continue;
            }
            return i - 1;
        }
        return length;
    }
}
